

***********************
** Study 2: Figure S2.7
***********************

* 2017
use "LondonBridgeAttack2017.dta", replace
sum id
local N = `r(N)'
sum statadate if statadate == td(03jun2017)
local attack = `r(mean)'
sum statadate if statadate == td(08jun2017)
local election = `r(mean)'
gen one = 1
collapse (sum) one, by(statadate)
twoway ///
	(bar one statadate, lcolor(black) barwidth(.65)) ///
	(bar one statadate if statadate == td(03jun2017), fcolor(red*.9) lcolor(red*.9) barwidth(.65)) ///
	(pcarrowi 5900 `attack' 4900 `attack', mcolor(black) lcolor(black)) ///
	(bar one statadate if statadate == td(08jun2017), fcolor(midblue) lcolor(midblue) barwidth(.65)) ///
	(pcarrowi 4800 `election' 3800 `election', mcolor(black) lcolor(black)) ///
	, ///
	ytitle("") ylabel(, angle(horizontal) nogrid) ymlabel(0(2500)15000, nolabels) ///
	xtitle("") xlabel(20964 20971 20978, angle(stdarrow) format(%tdMonth_dd) labgap(small) valuelabel) xmlabel(20963(1)20978, nolabels) ///
	title(2017, size(vlarge) color(black) margin(0 0 6 2)) legend(off) ///
	note("Total {it:N} = `N'", size(medsmall) margin(top)) ///
	text(6000 `attack' "Attack", place(n) orientation(vertical) size(small)) ///
	text(4900 `election' "Election", place(n) orientation(vertical) size(small)) ///
	scheme(s2mono) xsize(5) ysize(4) scale(1.1) plotregion(margin(sides)) graphregion(fcolor(white) ilcolor(white) lcolor(white)) bgcolor(white)
graph save "2017.gph", replace
	

* 2019
use "LondonBridgeAttack2019.dta", replace
sum id
local N = `r(N)'
sum statadate if statadate == td(29nov2019)
local attack = `r(mean)'
sum statadate if statadate == td(12dec2019)
local election = `r(mean)'
gen one = 1
collapse (sum) one, by(statadate)
twoway ///
	(bar one statadate, lcolor(black) barwidth(.65)) ///
	(bar one statadate if statadate == td(29nov2019), fcolor(red*.9) lcolor(red*.9) barwidth(.65)) ///
	(pcarrowi 2400 `attack' 1980 `attack', mcolor(black) lcolor(black)) ///
	(bar one statadate if statadate == td(12dec2019), fcolor(midblue) lcolor(midblue) barwidth(.65)) ///
	(pcarrowi 3970 `election' 3550 `election', mcolor(black) lcolor(black)) ///
	, ///
	ytitle("") ylabel(0 2000 4000 6000, angle(horizontal) nogrid) ymlabel(0(1000)6000, nolabels) ///
	xtitle("") xlabel(21881 21888 21895, angle(stdarrow) format(%tdMon_dd) labgap(small) valuelabel) xmlabel(21878(1)21895, nolabels) ///
	title(2019, size(vlarge) color(black) margin(0 0 6 2)) legend(off) ///
	note("Total {it:N} = `N'", size(medsmall) margin(top)) ///
	text(2450 `attack' "Attack", place(n) orientation(vertical) size(small)) ///
	text(4020 `election' "Election", place(n) orientation(vertical) size(small)) ///
	scheme(s2mono) xsize(5) ysize(4) scale(1.1) plotregion(margin(sides)) graphregion(fcolor(white) ilcolor(white) lcolor(white)) bgcolor(white)
graph save "2019.gph", replace	
	
* Graph combine
graph combine 2017.gph 2019.gph, iscale(*1.2) xsize(10) ysize(4) graphregion(fcolor(white) lcolor(white) lwidth(vthick)) plotregion(fcolor(white) lcolor(white))

* Erase individual graphs
erase "2017.gph"
erase "2019.gph"